home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / program / palis.lha / Palis / src / Com.c < prev    next >
C/C++ Source or Header  |  1992-09-02  |  1KB  |  84 lines

  1. /*
  2.     ·C·O·D·E·X· ·D·E·S·I·G·N· ·S·O·F·T·W·A·R·E·
  3.     presents
  4.  
  5.     PatchLibraries Utility
  6.  
  7.     FILE:    com.c
  8.     TASK:    establish cx control
  9.  
  10.     (c)1995 by Hans Bühler
  11. */
  12.  
  13. #include    "pl.h"
  14.  
  15. // ---------------------------
  16. // defines
  17. // ---------------------------
  18.  
  19. // ---------------------------
  20. // datatypes
  21. // ---------------------------
  22.  
  23. // ---------------------------
  24. // proto
  25. // ---------------------------
  26.  
  27. // ---------------------------
  28. // vars
  29. // ---------------------------
  30.  
  31. #ifndef FINAL
  32.  
  33. static struct NewBroker    NewBroker    =    {    NB_VERSION,
  34.                                                         PROGNAME,
  35.                                                         PROGNAME_FULL,
  36.                                                         "(c)1995 by Hans Bühler: Codex Design",
  37.                                                         NBU_UNIQUE|NBU_NOTIFY,
  38.                                                         0,
  39.                                                         0,                    // PRI set by tooltypes
  40.                                                         0                    // PORT set by prog
  41.                                                     };
  42.  
  43. CxObj                            *CxMain        =    0;
  44.  
  45. // ---------------------------
  46. // funx
  47. // ---------------------------
  48.  
  49. /******************
  50.  * run cx control *
  51.  ******************/
  52.  
  53. BOOL InitCom(void)
  54. {
  55.     ULONG                ErrCode;
  56.  
  57.     NewBroker.nb_Port    =    CxPort;
  58.     NewBroker.nb_Pri    =    0;            // getCX_PRI
  59.  
  60.     if(!( CxMain = CxBroker(&NewBroker,&ErrCode) ))
  61.     {
  62.         if(ErrCode != CBERR_DUP)
  63.             ErrorReq("ERROR: Cannot create cxBroker !",0,0,0,0);
  64.         return FALSE;
  65.     }
  66.  
  67.     return TRUE;
  68. }
  69.  
  70. /***********+************
  71.  * terminate cx control *
  72.  ***********+************/
  73.  
  74. void RemCom(void)
  75. {
  76.     if(CxMain)
  77.     {
  78.         ActivateCxObj(CxMain,FALSE);
  79.         DeleteCxObjAll(CxMain);
  80.     }
  81. }
  82.  
  83. #endif
  84.